package com.nuc.map;

import java.util.HashMap;
import java.util.Map;

public class MapTest {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        Map<Integer, String> gameBox = new HashMap<>();

        map.put("2001", "张三");
        map.put("2002", "张三");
        map.put("2003", "李四");
        map.put("2003", "王五");//键重复，会覆盖上一个，留下最新的

        gameBox.put(1,"守望先锋");
        gameBox.put(2,"cf");
        gameBox.put(3,"守望先锋2");
        gameBox.put(3,"守望先锋6");

        System.out.println(map);//{2003=王五, 2002=张三, 2001=张三}
        System.out.println(gameBox);
    }
}